import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

import vuexPersist from 'vuex-persist'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    localCodeFormatting1: "",
    localCodeFormatting2: "",
    localCodeFormatting3: "",
    isShow:true,
    textareaValue:""
  },
  getters: {
  },
  mutations: {
    setCodeFormatting1(state,value) {
      state.localCodeFormatting1 = value
    },
    setCodeFormatting2(state,value) {
      state.localCodeFormatting2 = value
    },
    setCodeFormatting3(state,value) {
      state.localCodeFormatting3 = value
    },
    clearDataHandler(state) {
      state.localCodeFormatting1 =  ""
      state.localCodeFormatting2 =  ""
      state.localCodeFormatting3 =  ""
    },
    editFlag (state) {
      state.isShow = !state.isShow
    },
    setTextarea(state,value) {
      state.textareaValue = value
    },
    removeTextarea(state) {
      state.textareaValue =  ""
    }
  },
  actions: {
  },
  modules: {

  },
  plugins: [new vuexPersist({
    storage: window.localStorage,
  }).plugin,]
})
